using System.Drawing;
using System.Windows.Forms;

namespace DiggThis.Forms
{
    /// <summary>
    /// Custom <see cref="ToolStripProfessionalRenderer"/> to override the default colors used
    /// to render the <see cref="ToolStrip"/>.
    /// </summary>
    internal class DiggThisRenderer : ToolStripProfessionalRenderer
    {
        /// <summary>
        /// Construct a new <see cref="DiggThisRenderer"/> instance using a customized <see cre="ProfessionalColorTable"/>.
        /// </summary>
        public DiggThisRenderer()
            : base(new DiggThisColorTable())
        {
            // Disable the rendering of round edges for the ToolStrip.
            RoundedEdges = false;
        }
    }
    /// <summary>
    /// Custom <see cref="ProfessionalColorTable"/> to override the default colors.
    /// </summary>
    internal class DiggThisColorTable : ProfessionalColorTable
    {
        /// <summary>
        /// Gets the starting color of the gradient used in the <see cref="ToolStrip" /> background.
        /// </summary>
        /// <returns>
        /// A <see cref="Color" /> that is the starting color of the gradient used in the <see cref="ToolStrip"/> background.
        /// </returns>
        public override Color ToolStripGradientBegin
        {
            get { return Color.FromArgb(62, 152, 180); }
        }
        /// <summary>
        /// Gets the end color of the gradient used in the <see cref="ToolStrip" /> background.
        /// </summary>
        /// <returns>
        /// A <see cref="Color" /> that is the end color of the gradient used in the <see cref="ToolStrip" /> background.
        /// </returns>
        public override Color ToolStripGradientEnd
        {
            get { return Color.FromArgb(236, 246, 249); }
        }
    }
}
